package com.neu.his.disease.serviceImpl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.neu.his.disease.entity.Disease;
import com.neu.his.disease.entity.Disecategory;
import com.neu.his.disease.mapper.DiseCategoryMapper;
import com.neu.his.disease.service.DiseaseService;
import com.neu.his.disease.service.DisecategoryService;

@Service
public class DisecategoryServiceImpl implements DisecategoryService{
	@Autowired
	private DiseCategoryMapper diseCategoryMapper;
	@Autowired
	private DiseaseService diseaseService;
	@Override
	public List<Disecategory> getAllDiseCategory(String dicaName, int dicaType) {
		// TODO Auto-generated method stub
		return diseCategoryMapper.getAllDiseCategory(dicaName, dicaType);
	}
	@Override
	public boolean addDiseCategory(Disecategory disecategory) {
		// TODO Auto-generated method stub
		int flag = diseCategoryMapper.addDiseCategory(disecategory);
		if(flag>0) {
			return true;
		}
		else {
			return false;
		}
	}
	@Override
	public boolean updateDiseCategory(Disecategory disecategory) {
		// TODO Auto-generated method stub
		int flag = diseCategoryMapper.updateDiseCategory(disecategory);
		if(flag>0) {
			return true;
		}
		else {
			return false;
		}
	}
	@Override
	public List<Disecategory> pageDiseCategoryQuery(int page, int limit, String dicaName, int dicaType) {
		// TODO Auto-generated method stub
		return diseCategoryMapper.pageDiseCategoryQuery(page, limit, dicaName, dicaType);
	}
	@Override
	public int pageDiseCategoryTotal(String dicaName, int dicaType) {
		// TODO Auto-generated method stub
		return diseCategoryMapper.pageDiseCategoryTotal(dicaName, dicaType);
	}
	@Override
	public boolean delereDiseCategoryQuery(int id) {
		// TODO Auto-generated method stub
		int flag = diseCategoryMapper.delereDiseCategoryQuery(id);
		if(flag>0) {
			return true;
		}
		else {
			return false;
		}
	}
	
	
}
